<template>
    <div>
        promise
        <div class="a"></div>
    </div>
</template>
<style>
.a {
    width: 100px;
    height: 100px;
    background-color: #f69e9e;
    margin: 10px;
    padding: 20px;
}
</style>
<script>
const p = new Promise((resolve, reject) => {
    reject('2');
    resolve('1');

});
p.then(
    data => {
        console.log('suc1', data);
        return 1;
    },
    data => {
        console.log('err1', data);//执行
        return 2;
    }
).then(
    data => {
        console.log('suc2', data);//执行
        throw new Error('我是error3')
    },
    data => {
        console.log('err2', data);
    }).then(
        data => {
            console.log('suc3', data);
        },
        data => {
            console.log('err3', data);//执行
        }
    )
</script>